package com.kabigon.learning;

import com.alibaba.ttl.TransmittableThreadLocal;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

public class SimpleDemo extends HttpServlet {
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        TransmittableThreadLocal<String> context = new TransmittableThreadLocal<>();

        //在父线程中设置
        context.set("value-set-in-parent");

        String value = context.get();

        System.out.println(value);

    }
}
